<div class="post" id="j<?php echo $data->id;?>">
	<div class="title">
		<?php echo CHtml::link(CHtml::encode($data->title), $data->url, array('onclick'=>'$(this).parent().parent().find(".content").toggle();return false;')); ?>
        <?php if (UserModule::isAdmin()): ?>
        <div class="admin-actions">
            <?php echo $data->adminLinks;?>
        </div>
        <?php endif;?>
	</div>
    <?php if($data->author != null): ?>
	<div class="author">
		<?php echo Yii::t('mj-base', 'posted by {author} on {date}', array(
            '{author}'=>$data->author->username,
            '{date}'=>Yii::app()->dateFormatter->format('M MMMM yyyy',$data->create_time)));
        ?>
	</div>
    <?php endif;?>
	<div class="content" <?php if ($this->action->id != 'view') echo 'style="display:none;"';?>>
		<?php $this->beginWidget('CMarkdown', array('purifyOutput'=>true));
			  echo CHtml::encode($data->content);
	          $this->endWidget();
		?>
	</div>
	<div class="nav">
		<b><?php echo Yii::t('mj-base', 'Tags');?>:</b>
		<?php echo implode(', ', $data->tagLinks); ?>
		<br/>
		<?php echo CHtml::link(Yii::t('mj-base', 'Leave Request'), $data->url); ?> |
		<?php echo Yii::t('mj-base', 'One request|{n} requests', $data->requestCount); ?> |
		<?php echo Yii::t('mj-base', 'Last updated on {date}', array('{date}'=>Yii::app()->dateFormatter->format('M MMMM yyyy',$data->create_time))); ?>
	</div>
</div>
